package flirtme.activities;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import flirtme.managers.UserManager;


public class SplashActivity extends Activity {
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		
		super.onCreate(savedInstanceState);
		
	
		UserManager um = UserManager.instance();
		um.loadUserPreferences((Context)this);
		
		
		final Class<? extends Activity> activityClass;
		if(um.getRememberSession()) {
	
			if (um.getProfileCreated()) {
				activityClass = MainMenuActivity.class;
			}
			else {
				activityClass = UserProfileActivity.class;
			}		    
		}
		else { 
			activityClass = LogInActivity.class;	
		}

		Intent intent = new Intent(this, activityClass);
		this.startActivity(intent);
		this.finish();
	}
	

}
